package com.example.qxfw.common.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qxfw.common.entity.TownshipForecastProvince;

import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/************************************
*
* @author : HuangDeYin Jolly
* @since : JDK 11
* @Date : 2023/8/10  星期四   10:34
* @description : 此类用来
***************************************/
@Mapper
@DS("qx")
public interface TownshipForecastProvinceMapperXml extends BaseMapper<TownshipForecastProvince> {
    /**
     * delete by primary key
     * @param stationid primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(@Param("stationid") String stationid, @Param("datechar") LocalDateTime datechar, @Param("timechar") String timechar, @Param("ntimes") Integer ntimes);

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(TownshipForecastProvince record);

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(TownshipForecastProvince record);

    /**
     * select by primary key
     * @param stationid primary key
     * @return object by primary key
     */
    TownshipForecastProvince selectByPrimaryKey(@Param("stationid") String stationid, @Param("datechar") LocalDateTime datechar, @Param("timechar") String timechar, @Param("ntimes") Integer ntimes);

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(TownshipForecastProvince record);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(TownshipForecastProvince record);

    List<TownshipForecastProvince> getList(@Param("dateChar") Timestamp dateChar, @Param("timeChar") String timeChar, @Param("nTimes") Integer nTimes, @Param("city") String city);

    @Select("select  datechar, timechar from township_forecast_province order by datechar,timechar desc limit 1")
    List<TownshipForecastProvince> getMaxTime();
}